<include file="../Public/header" />
<div id="content" interface="detail">
    <!-- 代码块（1） -->
    <div class="cob">
        <div id="c_{$weibo.feed_id}" isdig="{$weibo.is_digg}" class="c" cid="{$weibo.feed_id}" rowid="{$weibo.feed_id}" appid="{$weibo.uid}" page="xq_" feedtype="{$weibo.type}" isdel="{$weibo.api_source.is_del}">
            <!-- 判断是否被收藏 -->
            <php>if($weibo['iscoll']['colled']==1){</php>
                <div class="sc sc_1" id="sc_{$weibo.feed_id}" cid="{$weibo.feed_id}" type="feed"></div>
            <php>}else{</php>
                <div class="sc" id="sc_{$weibo.feed_id}" cid="{$weibo.feed_id}" type="feed"></div>
            <php>}</php>

            <div class="c_info">
                <div class="c_ava">
                    <img src="{$weibo['avatar_small']}" width=40 height=40>
                </div>
                <div class="info_text">
                    <div id="c_info_name_{$weibo.feed_id}" class="c_info_name">{$weibo['uname']}</div>
                    <div class="c_info_more_box">
                        <div class="c_time">{$weibo.publish_time|friendlyDate}</div>
                        <div class="c_digg_count">赞：{$weibo.digg_count}</div>
                        <div class="c_zf_count">转发：{$weibo.repost_count}</div>
                        <div class="c_comment_count">评论：{$weibo.comment_count}</div>
                    </div>
                </div>
            </div>
            <div id="c_content_{$weibo.feed_id}" class="c_content">
                <php>echo $weibo['content'];</php>
            </div>
            <!-- 这一段是显示微吧发的帖子 -->
            <php>if ($weibo['type'] == 'weiba_post'){</php>
                <div class="c_content">
                    <php>echo '【帖子内容】'.wapFormatContent($weibo['api_source']['content']);</php>
                </div>
            <php>}</php>
            <!-- 原微博的图 -->
            <php>if($weibo['feedType']=='postimage') {</php>
                <div id="feed_img_box_{$weibo[feed_id]}" class="feed_img_box">
                    <php>foreach($weibo['attach'] as $value){</php>
                        <img bm="{$value['attach_middle']}" class="feed_img" src="{$value['attach_small']}" linkto="{:U('w3g/Index/detail',array('weibo_id'=>$weibo['weibo_id']))}">
                    <php>}</php>
                </div>
            <php>}</php>
            <!-- 转发的原文内容 开始 -->
            <!-- 转发 -->
            <php>if (($weibo['type'] == 'repost' && $weibo['api_source']['is_del'] == '0') || ($weibo['type'] == 'repost' && $weibo['transpond_data']['api_source']['is_del'] == '0')) {</php>
                <div id="c_zf_box_{$weibo.feed_id}" class="c_zf_box c_zf_box_detail" data-original-id="{$weibo[app_row_id]}">
                    <dt class="bgcolor_arrow"><em class="arrline">◆</em><span class="downline">◆</span></dt>
                    <div class="c_zf_content">
                        <span class="c_zf_content_name">@{$weibo.transpond_data.uname}</span>:
                        <php>
                            echo wapFormatContent($weibo['transpond_data'][feed_content]);
                            if($weibo['transpond_data']['type'] == 'weiba_post'){
                                </php>
                                    <div class="loadweiba" weibaid="{$weibo.transpond_data.api_source.post_id}">
                                        查看全文
                                    </div>
                        <php>
                            }
                        </php>
                    </div>
                <!-- 转发的图 -->
                <php>if($weibo['transpond_data']['type']=='postimage') {</php>
                    <div class="feed_img_box">
                        <php>foreach($weibo['transpond_data']['attach'] as $value){</php>
                            <img bm="{$value['attach_middle']}" class="feed_img" src="{$value['attach_small']}" linkto="{:U('w3g/Index/detail',array('weibo_id'=>$weibo['weibo_id']))}">
                        <php>}</php>
                    </div>
                <php>}</php>
                    <div class="c_zf_info">
                        <div class="c_zf_info_time">{$weibo.transpond_data.publish_time|friendlyDate}</div>
                        <div class="c_zf_info_counts">
                            <span class="c_zf_info_count">转发:{$weibo.transpond_data.repost_count}</span>
                            <span class="c_zf_info_count">评论:{$weibo.transpond_data.comment_count}</span>
                            <span class="c_zf_info_count">赞:{$weibo.transpond_data.digg_count}</span>
                        </div>
                    </div>
                    <!-- 附件 -->
                    <div>
                        <php>if(isset($weibo['transpond_data']['attach']) && $weibo['transpond_data']['type'] == 'postfile'){</php>
                            <div class="attach_box">
                                <php>foreach($weibo['transpond_data']['attach'] as $value){
                                        switch($value['extension']){
                                            case 'png':$type='pic';break;
                                            case 'jpg':$type='pic';break;
                                            case 'jpeg':$type='pic';break;
                                            case 'bmp':$type='pic';break;
                                            case 'gif':$type='pic';break;
                                            case 'zip':$type='zip';break;
                                            case 'rar':$type='zip';break;
                                            case 'doc':$type='word';break;
                                            case 'docx':$type='word';break;
                                            case 'xls':$type='xls';break;
                                            case 'ppt':$type='ppt';break;
                                            case 'pdf':$type='pdf';break;
                                            default:$type='unknow';break;
                                        }
                                        $size=$value['size'];
                                        if($size > 1024 && $size< 1024*1024){
                                            $size=$size/1024;
                                            $size=round($size,2);
                                            $size.='K';
                                        }else if($size < 1024){
                                            $size.='B';
                                        }else{
                                            $size=$size/1024/1024;
                                            $size=round($size,2);
                                            $size.='M';
                                        }
                                </php>
                                    <a class="attachs_a" href="{:U('widget/Upload/down',array('attach_id'=>$value['attach_id']))}" type="<php>echo $value['extension'];</php>">
                                        <div class="attachs" style="background-image:url(img/attach/{$type}.png)">
                                            <div class="attachs_name">
                                                <php>echo $value['attach_name'];</php>
                                            </div>
                                            <div class="attachs_size">
                                                <php>echo $size;</php>
                                            </div>
                                        </div>
                                    </a>
                                <php>}</php>
                            </div>
                        <php>}</php>
                    </div>
                </div>
            <php>}elseif (($weibo['type'] == 'repost' && $weibo['api_source']['is_del'] == '1') || ($weibo['type'] == 'repost' && $weibo['transpond_data']['api_source']['is_del'] == '1')) {</php>
                <!-- 原微博已被删除 -->
                <div class="c_zf_box">
                    <dt class="bgcolor_arrow"><em class="arrline">◆</em><span class="downline">◆</span></dt>
                    <div class="c_zf_content">原文已被删除</div>
                </div>
            <php>}</php>
            <div>
                <php>if(isset($weibo['attach']) && $weibo['type'] == 'postfile'){</php>
                    <div class="attach_box">
                        <php>foreach($weibo['attach'] as $value){
                                switch($value['extension']){
                                    case 'png':$type='pic';break;
                                    case 'jpg':$type='pic';break;
                                    case 'jpeg':$type='pic';break;
                                    case 'bmp':$type='pic';break;
                                    case 'gif':$type='pic';break;
                                    case 'zip':$type='zip';break;
                                    case 'rar':$type='zip';break;
                                    case 'doc':$type='word';break;
                                    case 'docx':$type='word';break;
                                    case 'xls':$type='xls';break;
                                    case 'ppt':$type='ppt';break;
                                    case 'pdf':$type='pdf';break;
                                    default:$type='unknow';break;
                                }
                                $size=$value['size'];
                                if($size > 1024 && $size< 1024*1024){
                                    $size=$size/1024;
                                    $size=round($size,2);
                                    $size.='K';
                                }else if($size < 1024){
                                    $size.='B';
                                }else{
                                    $size=$size/1024/1024;
                                    $size=round($size,2);
                                    $size.='M';
                                }
                        </php>
                            <a class="attachs_a" href="{:U('widget/Upload/down',array('attach_id'=>$value['attach_id']))}" type="<php>echo $value['extension'];</php>">
                                <div class="attachs" style="background-image:url(img/attach/{$type}.png)">
                                    <div class="attachs_name">
                                        <php>echo $value['attach_name'];</php>
                                    </div>
                                    <div class="attachs_size">
                                        <php>echo $size;</php>
                                    </div>
                                </div>
                            </a>
                        <php>}</php>
                    </div>
                <php>}</php>
            </div>
        <!-- 转发的原文内容 结束 -->

        <!-- 微吧转发 -->
            <php>if ($weibo['type'] == 'weiba_repost' && $weibo['api_source']['is_del'] == '0') {</php>
            <div id="c_zf_box_{$weibo.feed_id}" class="c_zf_box">
                <dt class="bgcolor_arrow"><em class="arrline">◆</em><span class="downline">◆</span></dt>
                <div class="c_zf_content">
                    <span class="c_zf_content_name">@{$weibo.api_source.source_user_info.uname}</span>:
                    <php>echo wapFormatContent($weibo['api_source']['source_content']);
                        if($weibo['type'] == 'weiba_repost'){
                        </php>
                            <div class="loadweiba" weibaid="{$weibo.api_source.post_id}">
                                查看全文
                            </div>
                        <php>
                        }
                    </php>
                </div>
                <div class="c_zf_info">
                    <div class="c_zf_info_time">{$weibo.transpond_data.publish_time|friendlyDate}</div>
                    <div class="c_zf_info_counts">
                        <span class="c_zf_info_count">回复:{$weibo.api_source.reply_count}</span>
                        <span class="c_zf_info_count">浏览:{$weibo.api_source.read_count}</span>
                    </div>
                </div>
            </div>
            <php>}elseif($weibo['type'] == 'weiba_repost' && $weibo['api_source']['is_del'] == '1'){</php>
                <!-- 原微博已被删除 -->
                <div class="c_zf_box">
                    <dt class="bgcolor_arrow"><em class="arrline">◆</em><span class="downline">◆</span></dt>
                    <div class="c_zf_content">原文已被删除</div>
                </div>
            <php>}</php>
        </div>
        <div class="c_d">
            <div class="c_d_yes">
                <div class="c_d_text">
                    删除
                </div>
            </div>
            <div class="c_d_no">
                <div class="c_d_text">
                    取消
                </div>
            </div>
        </div>
    </div><!--.cob end-->
    <!-- 代码块(1) end -->
    <!-- 评论回复框 -->
    <div id="c_comment_post_box" weibo_id="{$weibo['feed_id']}" appid="{$weibo['uid']}">
        我来说两句...
    </div>
    <!-- 评论列表 -->
    <div id="c_comment_box">
        <!-- 循环开始 -->
        <volist name="comment" id="vo">
        <div class="c_comments" touid="{$vo.uid}" rowid="{$vo.row_id}" appuid="{$vo.app_uid}" ccid="{$vo.comment_id}">
            <!--这里的ccid为评论id  appuid为微博详情页原微博作者的ID rowid为原微博ID touid为原评论者的ID  -->
            <div class="c_comments_ava">
                <a href="#">
                    <img src="{$vo['user_info']['avatar_small']}" width=30 height=30>
                </a>
            </div>
            <div class="c_comments_content">
                <div class="c_comments_content_info">
                    <div class="c_comments_content_info_name" id="cc_name_{$vo.comment_id}">{$vo['user_info']['uname']}</div>
                    <div class="c_comments_content_info_time">
                        <php>$ctime=strtotime($vo[ctime])</php>{$ctime|friendlyDate}
                    </div>
                </div>
                <p class="c_comments_content_p">
                    <php>echo wapFormatContent($vo['content']);</php>
                </p>
            </div>
        </div>
        </volist>
        <!-- 循环结束 -->
        <!-- 分页 -->
        <php>$weibo[comment_count]==0?$count=1:$count=$weibo[comment_count];</php>
        <div id="pager_box">
            <php>if(empty($_GET['page']) || $_GET['page']==1){</php>
                <a href="javascript:;" link="" id="prev" class="pager_child pager_p_n_none ">上一页</a>
            <php>}else{</php>
                <a href="javascript:;" link="{:U('w3g/Index/detail',array('weibo_id'=>$_GET['weibo_id'],'page'=>$page-1))}" id="prev" class="pager_child pager_p_n ">上一页</a>
            <php>}</php>
            <select id="page_sel" class="pager_child">
                <php>
                    $_GET['page']!=0?$get=$_GET['page']:$get=1;
                    $_count = ceil($count/10);
                    if($get<6){
                        for($i=0;$i<($_count);$i++){
                            $get==$i+1?$selected='selected="selected"':$selected='';
                            if($i>9){
                                break;
                            }
                </php>
                <option value="{:U('w3g/Index/detail')}&page={$i+1}&weibo_id={$_GET['weibo_id']}" <php>echo $selected;</php>>第{$i+1}页</option>
                <php>   }
                    }elseif($get>=6){
                        for($i=($get-5);$i<$get;$i++){
                            $get==$i+1?$selected='selected="selected"':$selected='';
                </php>
                <option value="{:U('w3g/Index/detail')}&page={$i+1}&weibo_id={$_GET['weibo_id']}" <php>echo $selected;</php>>第{$i+1}页</option>
                <php>   }</php>
                <php>   for($i=$get;$i<($get+5);$i++){
                            $get==$i+1?$selected='selected="selected"':$selected='';
                            if($i>$_count-1){
                                break;
                            }
                </php>
                <option value="{:U('w3g/Index/detail')}&page={$i+1}&weibo_id={$_GET['weibo_id']}" <php>echo $selected;</php>>第{$i+1}页</option>
                <php>   }</php>
                <php>}</php>
                
            </select>
            <php>if($get == ($_count)) {</php>
                <a href="javascript:;" link="" id="next" class="pager_child pager_p_n_none">下一页</a>
            <php>}else{</php>
                <a href="javascript:;" link="{:U('w3g/Index/detail',array('weibo_id'=>$_GET['weibo_id'],'page'=>$page+1))}" id="next" class="pager_child pager_p_n">下一页</a>
            <php>}</php>
        </div>
    </div>
<include file="../Public/footer" />